<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text">
<div>div</div>
<span>span</span>
<img src="" alt="">
<script>
  //得到页面中的div
  let d = document.querySelector("div");
  //修改元素中的文本内容
  d.innerText = "修改后的内容";
  //得到span
  let s = document.querySelector("span");
  s.innerText = "这个span也被改了"
  //得到文本框
  let input = document.querySelector("input");
  //修改文本框的值
  input.value = "tom";
  //得到图片
  let img = document.querySelector("img");
  //修改显示的图片
  img.src = "../b.jpg";

</script>
</body>
</html>